﻿@using KC.Web.Account.Constants
@{
    ViewBag.Title = "用户操作日志";
    Layout = "~/Views/Shared/_ListLayout.cshtml";
}
<div id="toolbar">
    <div>
        <label>操作人:</label> 
        <input id="selectname" class="easyui-textbox" style="width: 200px" data-options="prompt:'请输入操作人'" />
        <a href="javascript:void(0)" onclick="searchData()" class="easyui-linkbutton" data-options="iconCls:'fa fa-search'">查询</a>
        <a href="javascript:void(0)" onclick="RefreshSearch()" class="easyui-linkbutton" data-options="iconCls:'fa fa-refresh'">刷新</a>
    </div>
</div>
<table id="datagrid"></table>
@section scripts
{
    <script type="text/javascript">
        $(function() {
            InitDataGrid();
        });

        var loadDataUrl = '@Url.Action(ActionName.User.LoadUserTracingLogList, ControllerName.User)';
        function InitDataGrid() {
            var $dataGrid = $('#datagrid').datagrid({
                url: loadDataUrl,
                method: 'get',
                striped: true,
                fitColumns: true,
                rownumbers: true,
                singleSelect: true,
                pagination: true,
                nowrap: false,
                fit: true,
                pageSize: 10,
                pageList: [10, 20, 50, 100],
                showFooter: false,
                toolbar: "#toolbar",
                //toolbar: [{ text: document.getElementById('toolbar') }],
                columns: [
                    [
                        //{ field: 'OperatorId', title: '操作人Id', width: 100, align: 'left' },
                        { field: 'Operator', title: '操作人', width: 100, align: 'left' },
                        { field: 'OperateDate', title: '操作日期', width: 100, align: 'left' },
                        { field: 'Remark', title: '内容', width: 500, align: 'left' }
                    ]
                ],
                onBeforeLoad: function(param) {
                },
                onLoadSuccess: function(data) {
                    $(".btnRemoveModule").linkbutton({ plain: true, iconCls: 'fa fa-trash' });
                },
                onLoadError: function() {
                }
            });

          
            $("#toolbar").keydown(function() {
                if (event.keyCode == "13") {
                    searchData();
                }

            });
        }

        function RefreshSearch() {
            $("#selectname").searchbox('setValue', '');
            searchData('', '');
        }
        function searchData() {
            $('#datagrid').datagrid('unselectAll');
            $("#datagrid").datagrid('load', { selectname: $("#selectname").searchbox("getValue") });
        }

    </script>
}
